home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / feel-075.lha / feel0.75 / Src / objects.h < prev    next >
C/C++ Source or Header  |  1992-06-18  |  3KB  |  168 lines

  1. /* ******************************************************************** */
  2. /*  structs.h        Copyright (C) Codemist and University of Bath 1989 */
  3. /*                                                                      */
  4. /* Basic definitions of tags and structures                             */
  5. /* ******************************************************************** */
  6.  
  7. /*
  8.  * Change Log:
  9.  *   Version 1, April 1989
  10.  *   added a little support for classes RJB
  11.  *   hacked it about a bit KJP
  12.  *   added semaphores KJP
  13.  */
  14.  
  15. #ifndef STRUCTS_H
  16. #define STRUCTS_H
  17.  
  18. #include <stdio.h>
  19.  
  20. #ifdef WITH_BIGNUMS
  21. #include "BigZ.h"
  22. #endif
  23. #undef BIGNUM
  24.  
  25. #ifndef SETJMP_H
  26. #define SETJMP_H
  27. #include <setjmp.h>
  28. #endif
  29.  
  30. /* Load system types... */
  31.  
  32. #include "system_t.h"
  33.  
  34. /* Type types */
  35. /* bits meaning
  36.  * 1-2 number of extend bits
  37.  * 3-4 ignore/GC/mark-compact/compact e0
  38.  * 5-6 ignore/GC/mark-compact/compact e1
  39.  * 7-8 ignore/GC/mark-compact/compact e2
  40.  * last field is (if it exists) always collected
  41.  */
  42. #define GC_IGNORE 0
  43. #define GC_GC 1
  44. #define GC_COMPACT 2
  45. #define GC_COMPACTGC 4
  46.  
  47. typedef struct value_struct
  48. {
  49.   int size;
  50.   LispObject base;
  51. } *value_box;
  52.  
  53. typedef union lispword_union
  54. {
  55.   LispObject obj;
  56.   int value;
  57.   value_box values;
  58. } lispword;
  59.  
  60. /* special cases */
  61.  
  62. typedef struct object_structure
  63. {
  64.   short gc;
  65.   short type;
  66.   LispObject class;
  67. } Object;
  68.  
  69. struct cons_structure
  70. {
  71.   Object header;
  72.   LispObject car,cdr;
  73. };
  74.  
  75. struct integer_structure
  76. {
  77.   Object header;
  78.   int value;
  79. };
  80.   
  81. struct float_structure
  82. {
  83.   Object header;
  84.   double fvalue;
  85. };
  86.  
  87. struct string_structure
  88. {
  89.   Object header;
  90.   values base;
  91.   int len;
  92. };
  93.   
  94. struct vector_structure
  95. {
  96.   Object header;
  97.   values base;
  98. };
  99.  
  100. /* template */
  101. struct lispob_structure  
  102. {
  103.   Object header;
  104.   lispword val0;
  105.   lispword val1;
  106.   lispword val2;
  107.   lispword val3;
  108. };
  109.  
  110. struct env_value_struct
  111. {
  112.   LispObject variable;
  113.   LispObject next;
  114.   LispObject value;
  115.   LispObject mutable;
  116. };
  117.  
  118. struct bignum_value_struct 
  119. {
  120. #ifdef WITH_BIGNUMS
  121.   BigZ          value;
  122. #endif
  123.  
  124.   int *         bnum;
  125. };
  126.  
  127.  
  128. struct complex_structure {
  129.   Object header;
  130.   LispObject    real;
  131.   LispObject    imaginary;
  132. };
  133.  
  134. struct ratio_structure {
  135.   Object header;
  136.   LispObject    numerator;
  137.   LispObject    denominator;
  138. };
  139.   
  140. struct character_structure
  141. {
  142.   Object header;
  143.   unsigned char    font;
  144.   unsigned char    code;
  145. };
  146.  
  147. struct symbol_value_structure {
  148.   LispObject    lmodule;  /* Module lookup cache for the interpreter */
  149.   LispObject    lvalue;   /* Part II */
  150.   LispObject    gvalue;   /* Dynamic global value */
  151.   LispObject    plist;
  152.   LispObject name;        /* a string */
  153.  
  154.   struct symbol_structure* left;
  155.   struct symbol_structure* right;
  156. };
  157.  
  158.  
  159. struct table_structure {
  160.   short        type;
  161.   short        gc;
  162.   LispObject    class;
  163.   LispObject    (*comparator)(/*+:Env,:+*/ LispObject, LispObject);
  164.   LispObject    lisp_comparator;
  165.   LispObject    tree;
  166. };
  167.  
  168.